﻿using Autofac;
using NhJump.Persistence.Wcf.Autofac.Services;

namespace NhJump.Persistence.Wcf.Autofac.IoC
{
    public interface IBootstrapper
    {
        IContainer Container { get; }
    }

    public class Bootstrapper : IBootstrapper
    {
        private readonly IContainer _container;

        public Bootstrapper()
        {
            var builder = new ContainerBuilder();
            builder.RegisterModule(new NHibernateComponentModule("ConnectionString", typeof (PersistenceService)));
            _container = builder.Build();
        }

        public IContainer Container
        {
            get { return _container; }
        }
    }
}